import request from '@/utils/request';

import type { trademarkResponseData, trademark } from './model/trademark'

enum API {
    TRADEMARKLIST = '/admin/product/baseTrademark/',
    ADDTRADEMARK= '/admin/product/baseTrademark/save',
    UPDATETRADEMARK= '/admin/product/baseTrademark/update',
    DELETETRADEMARK='/admin/product/baseTrademark/remove/',
}

export const reqTradeMarkList = (page: number, limit: number) => request.get<any,trademarkResponseData>(API.TRADEMARKLIST + `${page}/${limit}`);

export const reqAddOrUpdateTradeMark = (data:trademark)=>{
    if(data.id){
        return request.put<any,any>(API.UPDATETRADEMARK,data);
    }else{
        return request.post<any,any>(API.ADDTRADEMARK,data);
    }
}
export const reqDeleteTradeMark = (id:number)=>request.delete<any,any>(API.DELETETRADEMARK+id);